﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};

	var auditData = Jxstar.findComboData('audit');
	var process_stateData = Jxstar.findComboData('process_state');
	var moneytypeData = Jxstar.findComboData('moneytype');
	var authtypeData = Jxstar.findComboData('authtype');

	var cols = [
	{col:{header:'记录状态', width:87, sortable:true, align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: auditData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false,
			value: auditData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < auditData.length; i++) {
				if (auditData[i][0] == value)
					return auditData[i][1];
			}
		}}, field:{name:'project_process__auditing',type:'string'}},
	{col:{header:'项目编码', width:100, sortable:true}, field:{name:'project_process__project_code',type:'string'}},
	{col:{header:'项目名称', width:198, sortable:true}, field:{name:'project_process__project_name',type:'string'}},
	{col:{header:'是否调整', width:100, sortable:true, hidden:true}, field:{name:'project_process__is_turn',type:'string'}},
	{col:{header:'计划属性', width:100, sortable:true, hidden:true, align:'center',
		renderer:function(value){
			for (var i = 0; i < process_stateData.length; i++) {
				if (process_stateData[i][0] == value)
					return process_stateData[i][1];
			}
		}}, field:{name:'project_process__process_state',type:'string'}},
	{col:{header:'实施单位', width:110, sortable:true}, field:{name:'project_process__dept_name',type:'string'}},
	{col:{header:'项目类型', width:117, sortable:true, align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: moneytypeData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false,
			value: moneytypeData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < moneytypeData.length; i++) {
				if (moneytypeData[i][0] == value)
					return moneytypeData[i][1];
			}
		}}, field:{name:'project_process__money_type',type:'string'}},
	{col:{header:'授权形式', width:100, sortable:true, align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: authtypeData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false,
			value: authtypeData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < authtypeData.length; i++) {
				if (authtypeData[i][0] == value)
					return authtypeData[i][1];
			}
		}}, field:{name:'project_process__auth_type',type:'string'}},
	{col:{header:'计划金额(万元)', width:100, sortable:true, renderer:JxUtil.formatNumber(2)}, field:{name:'project_process__plan_money',type:'float'}},
	{col:{header:'项目论证完成时间', width:117, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m') : '';
		}}, field:{name:'project_process__date_projectlz',type:'date'}},
	{col:{header:'招投标完成时间', width:100, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m') : '';
		}}, field:{name:'project_process__date_ztb',type:'date'}},
	{col:{header:'合同签订完成时间', width:116, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m') : '';
		}}, field:{name:'project_process__date_contract',type:'date'}},
	{col:{header:'施工完成时间', width:100, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m') : '';
		}}, field:{name:'project_process__date_projectend',type:'date'}},
	{col:{header:'单项验收计划完成时间', width:151, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m') : '';
		}}, field:{name:'project_process__date_checkone',type:'date'}},
	{col:{header:'内部验收完成时间', width:116, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m') : '';
		}}, field:{name:'project_process__date_check',type:'date'}},
	{col:{header:'竣工审计财务决算时间', width:146, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m') : '';
		}}, field:{name:'project_process__date_moneycheck',type:'date'}},
	{col:{header:'竣工验收计划完成时间', width:132, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m') : '';
		}}, field:{name:'project_process__date_checkend',type:'date'}},
	{col:{header:'备注', width:213, sortable:true}, field:{name:'project_process__memo',type:'string'}},
	{col:{header:'主管部门', width:100, sortable:true, hidden:true}, field:{name:'project_process__done_deptname',type:'string'}},
	{col:{header:'编制人', width:100, sortable:true}, field:{name:'project_process__proecss_user',type:'string'}},
	{col:{header:'项目负责人', width:100, sortable:true, hidden:true}, field:{name:'project_process__project_user',type:'string'}},
	{col:{header:'编制时间', width:100, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m-d') : '';
		}}, field:{name:'project_process__proecss_date',type:'date'}},
	{col:{header:'是否结转', width:100, sortable:true, hidden:true}, field:{name:'project_process__has_turn',type:'string'}},
	{col:{header:'立项日期', width:100, sortable:true, hidden:true, renderer:function(value) {
			return value ? value.format('Y-m-d') : '';
		}}, field:{name:'project_process__project_checkdate',type:'date'}},
	{col:{header:'项目负责人ID', width:100, sortable:true, hidden:true}, field:{name:'project_process__project_userid',type:'string'}},
	{col:{header:'编制人ID', width:100, sortable:true, hidden:true}, field:{name:'project_process__proecss_userid',type:'string'}},
	{col:{header:'原计划ID', width:100, sortable:true, hidden:true}, field:{name:'project_process__process_oldid',type:'string'}},
	{col:{header:'主管部门ID', width:100, sortable:true, hidden:true}, field:{name:'project_process__done_deptid',type:'string'}},
	{col:{header:'主键', width:100, sortable:true, hidden:true}, field:{name:'project_process__process_id',type:'string'}},
	{col:{header:'项目ID', width:100, sortable:true, hidden:true}, field:{name:'project_process__project_id',type:'string'}},
	{col:{header:'部门ID', width:100, sortable:true, hidden:true}, field:{name:'project_process__dept_id',type:'string'}},
	{col:{header:'批复单位', width:100, sortable:true, hidden:true}, field:{name:'project_process__check_dept',type:'string'}},
	{col:{header:'计划批复文号', width:100, sortable:true, hidden:true}, field:{name:'project_process__check_fileno',type:'string'}}
	];
	
	config.param = {
		cols: cols,
		sorts: null,
		hasQuery: '1',
		isedit: '0',
		isshow: '1',
		funid: 'project_processquery'
	};
	
	config.eventcfg = {										newProcess: function(){			var records = this.grid.getSelectionModel().getSelections();			if (!JxUtil.selected(records)) return;						var processids = '';			for (var i = 0; i < records.length; i++) {				var processid = records[i].get('project_process__process_id');				processids += '&keyid=' + processid ;			}						var params = 'funid=project_processquery' + processids; 			params += '&pagetype=grid&eventcode=newProcess';						var self = this;			var endcall = function(data) {				//重新加载数据				self.grid.getStore().reload();								//刷新目标表格				var destGrid = self.grid.destGrid;				if (destGrid != null) {					destGrid.getStore().reload();				}			};			//发送请求			Request.postRequest(params, endcall);		}
	};
		
	return new Jxstar.GridNode(config);
}